package pit.com.ordermobilesystem.widget;


import pit.com.ordermobilesystem.R;
import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class OrderDialog extends Dialog{

	public OrderDialog(Context context,final View.OnClickListener click_ok) {
		super(context, R.style.Theme_Transparent);
		setContentView(R.layout.view_order_dialog);
		setCancelable(false);
		Button bt_ok=(Button) findViewById(R.id.bt_ok);
		bt_ok.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View view) {
				OrderDialog.this.dismiss();
				click_ok.onClick(view);
				
			}
		});
	}
	
	public void setData(double sum,double discount){
		TextView tv_sum=(TextView) findViewById(R.id.tv_sum);
		TextView tv_discount=(TextView) findViewById(R.id.tv_discount);
		TextView tv_pay=(TextView) findViewById(R.id.tv_pay);
		tv_sum.setText(""+sum);
		tv_discount.setText(""+discount);
		tv_pay.setText(""+(sum-discount));
		
	}

}
